<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>stringify&parse</title>
    <script src="../jquery-1.7.2.js"></script>
</head>
<body>
<p>
    <span id="a"></span>
    <span id="b"></span>
    <h5>看看console</h5>
</p>
<script>
    $(function(){
        var person = {
            name:'saad',
            age:26,
            department:{
                id:15,
                aka:'tank'
            }
        };
        var stringFormPerson =JSON.stringify(person);
        $('#a').html(stringFormPerson);
        var personFromString = JSON.parse(stringFormPerson);
        console.log(stringFormPerson);
        console.log(personFromString);

    })
</script>
</body>
</html>